package com.ynny.chapter04.controller;

import com.ynny.chapter04.common.R;
import com.ynny.chapter04.entity.User;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {


    @PostMapping("/edit")
    public R edit(@Valid @RequestBody User user)  {
        log.info("接收到编辑用户请求: {}", user);
        // 模拟更新用户



        return R.ok(user);
    }


}